package com.yanqu.road.server.channelserver.manager.log;

import com.yanqu.road.server.channelserver.manager.log.impl.ChannelLogEnterNameLogic;
import com.yanqu.road.server.channelserver.manager.log.impl.ChannelLogWasheLogic;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.ArrayList;
import java.util.List;

public class ChannelLogMgr {

    private static final Logger logger = LogManager.getLogger(ChannelLogMgr.class.getName());

    private static List<BaseChannelLog> logList = new ArrayList<>();

    // 往这边加类型
    static {
        logList.add(new ChannelLogWasheLogic());
        logList.add(new ChannelLogEnterNameLogic());
    }

    public static void save() {
        for (BaseChannelLog baseChannelLog : logList) {
            try {
                baseChannelLog.save();
            } catch (Exception e) {
                logger.error("error : ", e);
            }
        }
    }

}
